package com.osexp.model;

import java.util.List;

public class oProcess implements paraConstants{
	int pid;
	private traceReader nfr=new traceReader();
	
	private List<trace> tList=null;
	
	int curr;
	Double waitTime;
	public Double getWaitTime() {
		return waitTime;
	}

	public void setWaitTime(Double waitTime) {
		this.waitTime = waitTime;
	}

	public Double getExecutionTime() {
		return executionTime;
	}

	public void setExecutionTime(Double executionTime) {
		this.executionTime = executionTime;
	}

	Double executionTime;
	public oProcess(int pid) {
		super();
		this.pid=pid;
		nfr=new traceReader();
		tList=nfr.formatRead("trace"+(pid+1)+".txt");	
		curr=0;
		waitTime=0.0;
		executionTime=0.0;
	}
	
	public trace next() {
		int i=0;
		for(trace t:tList){
			if(curr==i){
				curr++;
				return t;				
			}
			i++;
		}		
		return null;		
	}

	public List<trace> gettList() {
		return tList;
	}

	public void settList(List<trace> tList) {
		this.tList = tList;
	}
}
